package com.hlhj.funlike_businessqzxd.moudle;

import android.content.Context;

import com.example.mymvp.mvp.BaseModule;
import com.hlhj.funlike_businessqzxd.api.Apis;
import com.hlhj.funlike_businessqzxd.api.BaseObser;
import com.hlhj.funlike_businessqzxd.bean.ShopInfoBean;
import com.lzy.okgo.model.Response;

public class MainMoudle implements BaseModule{
    public interface getShopStatus{
        void loadShopInfo(ShopInfoBean.DataBean dataBean);
    }

    public getShopStatus listener;

    public void setListener(getShopStatus listener) {
        this.listener = listener;
    }

    public void LoadShopInfo(Context context){
        Apis.INSTANCE.ShopConfig()
                .subscribe(new BaseObser<Response<ShopInfoBean>>(context) {
                    @Override
                    public void httpSuccess(Response<ShopInfoBean> shopInfoBeanResponse) {
                        if (listener!=null){
                            listener.loadShopInfo(shopInfoBeanResponse.body().getData());
                        }
                    }
                });
    }
}
